<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"

      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <h:form id="cepForm" enctype="multipart/form-data">
                <h1 class="title">Cidade</h1>
                <p:growl id="messages" showDetail="true" autoUpdate="true" /> 
                <div class="row">
                    <div class="twelve columns"> 
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Visualizar</h4></legend>
                            <p:panel id="charterPanel" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix ">
                                
                                <p:outputLabel value="Cidade" styleClass="grid_3"/>
                                <p:inputText value="#{managerSearchCity.city.name}" styleClass="grid_8"/>
                                
                                
                                    <div class="buttonAction">
                                    <p:commandButton value="Pesquisar" actionListener="#{managerSearchCity.searchCity()}"
                                                     icon="ui-icon-search"
                                                     update="@form, dataTable" styleClass="ui-priority-primary" />
                                    <p:commandButton value="Limpar"  icon="ui-icon-trash" />
                                </div>
                                <p:dataTable id="dataTable"
                                             value="#{managerSearchCity.citys}"
                                             var="city" rows="5" paginator="true" 
                                             emptyMessage="Nenhum registro encontrado" >
                                    <f:facet name="header">
                                        Cidade
                                    </f:facet>
                                    <p:column headerText="Cidade">
                                        #{city.name}
                                    </p:column>
                                    <p:column headerText="Estado">
                                        #{city.country.name}
                                    </p:column> 

                                </p:dataTable>
                            </p:panel>
                        </fieldset>
                        <br/>

                    </div>
                </div>
            </h:form>
        </ui:define>
    </ui:composition>

</html>